<!DOCTYPE html>
<html>

<head id="Head1" runat="server">
  <title>问题快反待办</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <link rel="Shortcut Icon" href="images/aecc.ico" type="image/x-icon" />
  <link rel="stylesheet" href="Content/layui/css/layui.css" />
  <script type="text/javascript" src="Scripts/json2.js"></script>
  <script type="text/javascript" src="Scripts/jquery-1.11.2.min.js"></script>
  <script type="text/javascript" src="Scripts/crypto-js.min.js"></script>
  <script type="text/javascript" src="Scripts/secret.js"></script>
  <style type="text/css">
    .layui-form-item .layui-input-inline {
      margin-right: 0;
    }

    body {
      font-family: "微软雅黑";
    }

    .header-title {
      height: 60px;
      line-height: 60px;
      text-align: center;
      font-size: 20px;
      font-weight: bold;
    }

    /*单元格样式设置*/
    .layui-table-body .layui-table-cell {
      font-size: 13px;
      text-align: center;
      color: #000;
    }

    .layui-form-item {
      margin-bottom: 5px;
    }

    .layui-form-label {
      padding: 9px 5px;
      width: 100px;
    }

    .layui-form-item .layui-inline {
      margin-bottom: 0px;
      margin-right: 0px;
    }

    .layui-table-view {
      margin: 0;
    }

    .layui-table-view th {
      font-weight: bold;
      font-size: 14px;
      text-align: center;
      color: #1E9FFF;
    }

    .layui-card-header {
      font-weight: bold;
      color: #1E9FFF;
      text-align: center;
      font-size: 18px;
    }

    .layui-card-body {
      padding: 0px;
    }

    #btnSearch,
    #btnReset,
    #btnPrint {
      font-weight: bold;
      font-size: 14px !important;
    }

    .layui-btn {
      font-weight: bold;
      font-size: 12px !important;
    }

    .layui-layer-title {
      text-align: center;
      font-weight: bold;
      font-size: 18px !important;
      color: #1E9FFF !important;
    }

    .layui-disabled,
    .layui-disabled:hover {
      color: #000 !important;
    }

    .layui-elem-quote {
      margin-bottom: 5px;
      margin-top: 5px;
      padding: 15px;
      line-height: 22px;
      border-left: 5px solid #009688;
      border-radius: 0 2px 2px 0;
      background-color: #f2f2f2;
    }

    td[data-field="tasktitle"] div {
      text-align: left !important;
      padding-left: 10px;
    }

    .link {
      color: #000;
      text-decoration: underline;
    }

    .link:hover {
      color: Blue;
    }


    .layui-table {
      margin: 0;
    }

    /*处理IE8模板列边框显示bug*/
    #grid table {
      border-collapse: separate !important;
    }

    .layui-table-cell {
      padding: 0px;
      padding-left: 5px;
    }

    .layui-table-view .layui-table td {
      padding: 0;
      color: #000;
      font-size: 12px !important;
    }

    .layui-table-view th {
      font-size: 14px !important;
      font-weight: bold;
      text-align: center;
      color: #1E9FFF !important;
    }
  </style>
</head>

<body>
  <!--[if lt IE 9]>
        <script src="Scripts/pollyfills/html5.js"></script>
        <script src="Scripts/pollyfills/response.js"></script>
        <script src="Scripts/array.pollyfill.js"></script>
    <![endif]-->

  <div class="layui-row layui-bg-blue" style="padding: 0 15px; margin-bottom: 5px;">
    <div class="layui-col-md3">
      <div>
        <img src="images/aeec_logo.png" height="60" alt="黎阳LOGO" />
      </div>
    </div>
    <div class="layui-col-md6 header-title">
      问题快反待办
    </div>
    <div class="layui-col-md3" style="height: 60px; line-height: 60px; text-align: right;
            font-size: 16px; font-weight: bold; color: #fff; padding-right: 15px;" id="currentTime">
    </div>
  </div>

  <div style="margin:0 10px;">
    <form class="layui-form" action="">
      <table class="layui-table" id="grid"></table>
    </form>
  </div>

  <!-- 页眉区域 end-->
  <script type="text/javascript" src="content/layui/layui.js"></script>
  <script type="text/javascript">
    $(function () {
      layui.use(['form', 'layer', 'table', 'laydate'], function () {
        var $ = layui.$;
        var table = layui.table;
        var grid = null;
        var index = null;
        var url = "";
        if (window.navigator.userAgent.indexOf('MSIE') !== -1) {
          url = "http://10.15.7.194:8088/portal/ssologin_mes_feedback_new2.jsp?url=";
        } else {
          var url = "http://10.15.7.194:8088/portal/ssologin_mes_feedback_new3.jsp?url=";
        }


        function getParam(name) {
          try {
            var url = window.document.location.href;
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = url.split('?')[1].match(reg);
            if (r != null) {
              return r[2];
            }
            return "";
          } catch (e) {
            return "";
          }
        }

        function GetData() {
          grid = table.render({
            elem: '#grid'
            , url: "Ashx/mesFeedBackTaskList.ashx"
            , method: 'POST'
            , cols: [[
              { type: 'numbers', title: '序号', width: 60 }
              , {
                field: 'tasktitle', title: '待办项', width: 750,
                templet: function (d) {
                  return "<a class='link' href=" + url + Encrypt(d.taskurl) + " target='_blank'>" + d.tasktitle + "</a>";
                }
              }
              , {
                field: 'fullname', title: '当前节点待办人',
                templet: function (d) {
                  return d.fullname + '【' + d.employeename + '】';
                }
              }
              , { field: 'tasktype', title: '任务类型', width: 100 }
              , {
                field: 'prevuser', title: '上一节点办理人',
                templet: function (d) {
                  if (d.fullname2 !== null) {
                    return d.fullname2 + '【' + d.employeename2 + '】';
                  } else {
                    return "";
                  }

                }
              }
              , {
                field: 'begintime', title: '上一节点办理日期',
                templet: function (d) {
                  if (d.begintime !== null) {
                    return d.begintime.replace('T', ' ');
                  } else {
                    return d.begintime;
                  }
                }
              }

              , {
                field: '', title: '查询待办任务时间', width: 180,
                templet: function (d) {
                  return new Date().toLocaleString();
                }
              }
            ]]
            , where: {
              employeeid: Decrypt(getParam("employeeid"))
            }
            , text: {
              none: '暂无问题快反待办'
            }
            , request: {
              pageName: 'page',
              limitName: 'rows'
            }
            , page: false
            , done: function (res, curr, count) {
              var that = this.elem.next();
              res.data.forEach(function (item, index) {
                if (index % 2 !== 0) {
                  that.find(".layui-table-box tbody tr[data-index='" + index + "'] div").css({ "background": "#eee", "color": "#000" }); //FA8072,FF4500
                }
              });
            }
          });
        }
        GetData();

        setInterval(function () {
          GetData();
        }, 60000)
      });
    });
  </script>
</body>

</html>